package com.ruoyi.project.system.coinrecord.service.impl;

import javax.annotation.Resource;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.utils.uniquekey.IdGererateFactory;
import com.ruoyi.project.system.coinrecord.dto.HaoqiCoinRecordDto;
import com.ruoyi.project.system.coinrecord.mapper.HaoqiCoinRecordMapper;
import com.ruoyi.project.system.coinrecord.domain.HaoqiCoinRecord;
import com.ruoyi.project.system.coinrecord.service.IHaoqiCoinRecordService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 好奇币记录Service业务层处理
 * 
 * @author f_baisi
 * @date 2020-06-29
 */
@Service
public class HaoqiCoinRecordServiceImpl implements IHaoqiCoinRecordService 
{
    @Resource
    private IdGererateFactory idGererateFactory;
    @Autowired
    private HaoqiCoinRecordMapper haoqiCoinRecordMapper;

    /**
     * 查询好奇币记录
     * 
     * @param id 好奇币记录ID
     * @return 好奇币记录
     */
    @Override
    public HaoqiCoinRecord selectHaoqiCoinRecordById(String id)
    {
        return haoqiCoinRecordMapper.selectHaoqiCoinRecordById(id);
    }

    /**
     * 查询好奇币记录列表
     * 
     * @param haoqiCoinRecord 好奇币记录
     * @return 好奇币记录
     */
    @Override
    public List<HaoqiCoinRecordDto> selectHaoqiCoinRecordList(HaoqiCoinRecord haoqiCoinRecord)
    {
        return haoqiCoinRecordMapper.selectHaoqiCoinRecordList(haoqiCoinRecord);
    }

    /**
     * 新增好奇币记录
     * 
     * @param haoqiCoinRecord 好奇币记录
     * @return 结果
     */
    @Override
    public int insertHaoqiCoinRecord(HaoqiCoinRecord haoqiCoinRecord)
    {
        haoqiCoinRecord.setId(this.idGererateFactory.nextStringId());
        return haoqiCoinRecordMapper.insertHaoqiCoinRecord(haoqiCoinRecord);
    }

    /**
     * 修改好奇币记录
     * 
     * @param haoqiCoinRecord 好奇币记录
     * @return 结果
     */
    @Override
    public int updateHaoqiCoinRecord(HaoqiCoinRecord haoqiCoinRecord)
    {
        return haoqiCoinRecordMapper.updateHaoqiCoinRecord(haoqiCoinRecord);
    }

    /**
     * 删除好奇币记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteHaoqiCoinRecordByIds(String ids)
    {
        return haoqiCoinRecordMapper.deleteHaoqiCoinRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除好奇币记录信息
     * 
     * @param id 好奇币记录ID
     * @return 结果
     */
    @Override
    public int deleteHaoqiCoinRecordById(String id)
    {
        return haoqiCoinRecordMapper.deleteHaoqiCoinRecordById(id);
    }
}
